<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>color demo</title>
    <link rel="stylesheet" href="https://www.unpkg.com/ew-color-picker/dist/ew-color-picker.min.css">
</head>

<body>
    <div class="demo"></div>
    <script src="https://www.unpkg.com/ew-color-picker/dist/ew-color-picker.min.js"></script>
    <!-- <script src="../dist/ew-color-picker.js"></script> -->
    <script>
        const colorConfig = {
            el:".demo",
            alpha:true,
            alphaDirection:"horizontal",
            openChangeColorMode:true,
            changeColor:(color) => {
                // console.log('颜色值改变',color)
            },
            hueDirection:"horizontal",
            isClickOutside:false,
            // pickerAnimation:"height",
            pickerAnimationTime:350,
            predefineColor:[
                "red",
                "#2396ef",
                {
                    color:"rgba(255,231,11,.3)"
                },
                {
                    color:"hsla(255,23%,11%,.9)",
                    disabled:true
                },
                {
                    color:"hsla(125,53%,31%)",
                },
                {
                    color:"rgb(105,53,31)",
                }
            ],
            togglePicker(el,flag,context) {
                // console.log(el,flag,context)
            }
        }
        const color = new ewColorPicker(colorConfig);
    </script>
</body>

</html>